#ifndef __CORE_API_H__
#define __CORE_API_H__

/**
 *  core/api.h
 *  hlavickovy soubor, kde je obsluha pro
 *  API. Tato cast se pri zavedeni OS inicializuje
 *  a pote se uz jen pouziva pri volani API
 */

/* cislo interruptu naseho operacniho systemu */
#define OSINT 0x50

/* struktura potrebna pro vykonani API funkci */
typedef struct {
  unsigned int ax;
  unsigned int bx;
  unsigned long segment;
} _regs;

/* kolikrat bylo zavolani nejake API? */
unsigned long long _api_counter = 0;

/*
 *  globalni promenne, nachazi se v nich segment, kde se nachazi aplikace,
 *  ze ktere byla volana API
 */
unsigned int   _api_segment   = 0;
unsigned long  _api_lsegment  = 0;

int  init_api         (void);
void poke             (unsigned int cis, unsigned int sic, int val);
void SetInterrupt     (unsigned char IntNo, unsigned int handler);
void APIHandler       (_regs *r);
void interrupt _int   ();

#include <drivers/apm.h>
#include <core/init.h>
#include <core/stdio.h>
#include <stdarg.h>

#include <source/core/api.c>

#endif
